Question: Find the distance from the point $(1,-1,2)$ to the line passing through $(-2,2,1)$ and $(-1,-1,3).$
Answer: Let $\mathbf{a} = \begin{pmatrix} 1 \\ -1 \\ 2 \end{pmatrix}.$  The line can be parameterized by
\[\bold{v} = \begin{pmatrix} -2 \\ 2 \\ 1 \end{pmatrix} + t \begin{pmatrix} 1 \\ -3 \\ 2 \end{pmatrix} = \begin{pmatrix} -2 + t \\ 2 - 3t \\ 1 + 2t \end{pmatrix}.\]If $\bold{v}$ is the vector that is closest to $\bold{a}$, then the vector joining $\bold{v}$ and $\bold{a}$ is orthogonal to the direction vector of the line.  This vector is
\[\mathbf{v} - \mathbf{a} = \begin{pmatrix} -2 + t \\ 2 - 3t \\ 1 + 2t \end{pmatrix} - \begin{pmatrix} 1 \\ -1 \\ 2 \end{pmatrix} = \begin{pmatrix} -3 + t \\ 3 - 3t \\ -1 + 2t \end{pmatrix}.\][asy]
unitsize (0.6 cm);

pair A, B, C, D, E, F, H;

A = (2,5);
B = (0,0);
C = (8,0);
D = (A + reflect(B,C)*(A))/2;

draw(A--D);
draw((0,0)--(8,0));

dot("$\mathbf{a}$", A, N);
dot("$\mathbf{v}$", D, S);
[/asy]

Hence,
\[\begin{pmatrix} -3 + t \\ 3 - 3t \\ -1 + 2t \end{pmatrix} \cdot \begin{pmatrix} 1 \\ -3 \\ 2 \end{pmatrix} = 0,\]so $(-3 + t)(1) + (3 - 3t)(-3) + (-1 + 2t)(2) = 0.$  Solving for $t$, we find $t = 1.$

Then the distance between the point and the line is
\[\| \mathbf{v} - \mathbf{a} \| = \left\| \begin{pmatrix} -2 \\ 0 \\ -1 \end{pmatrix} \right\| = \boxed{\sqrt{5}}.\]